package net.bwie.udf;

import ch.hsr.geohash.GeoHash;
import org.apache.hadoop.hive.ql.exec.UDF;

/**
 * 简介说明:
 *
 * @author: LiLi
 * @date: 2025/04/17 09:51:43
 * @version: 1.0
 */
public class convert_geohash extends UDF {
    public String evaluate(double lat,double lng,int pre){
        GeoHash geoHash = GeoHash.withCharacterPrecision(lat, lng, pre);
        return geoHash.toBase32();
    }

    public static void main(String[] args) {
        System.out.println(new convert_geohash().evaluate(39.92998577808024,116.39564503787867,6));
    }
}
